﻿// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "custom/area/effect2" {
    Properties {
        _Color ("Tint", Color) = (1,1,1,1)
        _Bright("Bright", Float) = (0.5,0.5,0.5,0.5)
        _Range("Range", Float) = 0.05
        _Freq("Freq", Float) = 3.141526
    }
    
    SubShader {
		
		Tags
		{
			"Queue"="Transparent" 
			"IgnoreProjector"="True" 
			"RenderType"="Transparent" 
			"PreviewType"="Plane"
			"CanUseSpriteAtlas"="True"
		}
		
		Pass {
			Cull Off
			Lighting Off
			ZWrite Off
			Fog { Mode Off }
			Blend DstColor SrcColor
			CGPROGRAM
			#pragma vertex vert
			#pragma fragment frag

			#include "UnityCG.cginc"
			
			struct appdata_t
			{
				float4 vertex   : POSITION;
				float4 color    : COLOR;
			};

			struct v2f
			{
				float4 vertex   : SV_POSITION;
				fixed4 color    : COLOR;
			};

			float4 _Bright;
			float _Range;
			float _Freq;
			
			v2f vert (appdata_t v)
			{
				v2f o;
				o.vertex = UnityObjectToClipPos (v.vertex);
				o.color = _Bright + _Range + _Range * sin(_Time.y * _Freq);
				return o;
			}

			fixed4 frag (v2f i) : SV_Target
			{
				return i.color;
			}
			ENDCG

        }
    }
}